gtkwindow: ignore default size if there is a size request
authorOlivier Fourdan <ofourdan@redhat.com>
Wed, 16 Mar 2016 13:19:14 +0000 (14:19 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 18 Mar 2016 02:40:42 +0000 (22:40 -0400)
Some applications set both a default size on their gtk window and a size
request on the corresponding gtk widget.

Until now, the default size was ignored for fixed size windows, so this
had no effect and remained unnoticed, but with the recent change for
client-side decorations, the default size is now used even for fixed size
windows, which can cause the resulting fixed size window to be much
smaller than expected with the size request.

For fixed size windows, if we have both a size request and a default
size set, prefer the size request as before.

https://bugzilla.gnome.org/show_bug.cgi?id=763749

gtk/gtkwindow.c

index 6b21e0bf238650885fb95c50744b624e4be243ec..789bb1ef1b4fc0c348ec3126b84f44f44953ee42 100644 (file)
@@ -9787,9 +9787,11 @@ gtk_window_update_fixed_size (GtkWindow   *window,
 {
   GtkWindowPrivate *priv = window->priv;
   GtkWindowGeometryInfo *info;
+  gboolean has_size_request;
 
   /* Adjust the geometry hints for non-resizable windows only */
-  if (priv->resizable)
+  has_size_request = gtk_widget_has_size_request (GTK_WIDGET (window));
+  if (priv->resizable || has_size_request)
     return;
 
   info = gtk_window_get_geometry_info (window, FALSE);